package com.kr.weitao.util.oss;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by whale_xdl on 2017/7/11.
 */
@Configuration
@EnableConfigurationProperties(OssProperties.class)
@ConditionalOnClass(OssClient.class)
public class OssAutoConfiguration {
    @Autowired
    OssProperties ossProperties;

    @Bean
    public OssClient getOssClient(){
        OssClient ossClient=new OssClient();
        ossClient.setOssProperties(ossProperties);
        return ossClient;
    }
//    @Bean
//    public OssProperties getOssProperties(){
//        return this.ossProperties;
//    }

}
